import random

comp = random.randint(10, 99)
user = int(input())
a = comp // 10
b = comp % 10
x = user // 10
y = user % 10
print(comp)
if user == comp:
    print(10000)
elif a == y and b == x:
    print(3000)
elif a == x or a == y or b == x or b == y:
    print(1000)
else:
    print(0)
